//
// Created by haoy on 2017/5/8.
//

#ifndef RTC_XSWITCH2_RTCP_DEBUG_HPP
#define RTC_XSWITCH2_RTCP_DEBUG_HPP

#include <stdint.h>

#include "xrtc_endpoint.h"
#include "xsdp.h"

typedef void* rtcp_handler_t;

rtcp_handler_t rtcp_handler_new(rtc_endpoint_t rtc, uint32_t ssrc, uint32_t placeholder_ssrc);
void rtcp_handler_destroy(rtcp_handler_t generator);

typedef struct {
    uint32_t last_lost_rate_avg;

    uint8_t lost_frac;
    uint32_t lost_cumulative;
    uint32_t extended_highest_seq;
    uint32_t inter_arrival_jitter;
    uint32_t lsr;
    uint32_t dlsr;
} rtcp_report_t;

void rtcp_handler_get_report(rtcp_handler_t self, rtcp_report_t& report);
#endif //RTC_XSWITCH2_RTCP_DEBUG_HPP
